home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / os-includeppc / powerpc / tasksPPC.h < prev    next >
C/C++ Source or Header  |  1998-04-07  |  4KB  |  137 lines

  1. #ifndef POWERPC_TASKSPPC_H
  2. #define POWERPC_TASKSPPC_H
  3.  
  4. /*
  5. **  $VER: tasksPPC.h 2.0 (15.03.98)
  6. **  WarpOS Release 14.1
  7. **
  8. **  '(C) Copyright 1998 Haage & Partner Computer GmbH'
  9. **       All Rights Reserved
  10. */
  11.  
  12.  
  13. #ifndef EXEC_TASKS_H
  14. #include <exec/tasks.h>
  15. #endif
  16.  
  17. #ifndef UTILITY_TAGITEM_H
  18. #include <utility/tagitem.h>
  19. #endif
  20.  
  21. /* private structure */
  22.  
  23. struct TaskLink {
  24.         struct MinNode tl_Node;
  25.         APTR tl_Task;
  26.         ULONG tl_Sig;
  27.         UWORD tl_Used;
  28. };
  29.  
  30. /* task structure for ppc. fields not commented are private*/
  31.  
  32. struct TaskPPC {
  33.         struct Task tp_Task;                    /* exec task structure */
  34.         ULONG tp_StackSize;                     /* stack size: read only */
  35.         APTR tp_StackMem;
  36.         APTR tp_ContextMem;
  37.         APTR tp_TaskPtr;
  38.         ULONG tp_Flags;                         /* flags (see below): read only */
  39.         struct TaskLink tp_Link;
  40.         APTR tp_BATStorage;
  41.         ULONG tp_Core;
  42.         struct MinNode tp_TableLink;
  43.         APTR tp_Table;                          /* task's page table: read only */
  44.         ULONG tp_DebugData;                     /* free space for debuggers */
  45.  
  46.         UWORD tp_Pad;
  47.         ULONG tp_Timestamp;
  48.         ULONG tp_Timestamp2;
  49.         ULONG tp_Elapsed;
  50.         ULONG tp_Elapsed2;
  51.         ULONG tp_Totalelapsed;
  52.         ULONG tp_Quantum;
  53.         ULONG tp_Priority;
  54.         ULONG tp_Prioffset;
  55.         APTR tp_PowerPCBase;
  56.         ULONG tp_Desired;
  57.         ULONG tp_CPUusage;                      /* CPU usage: read only */
  58.         ULONG tp_Busy;                          /* busy time: read only */
  59.         ULONG tp_Activity;                      /* activity: read only */
  60.         ULONG tp_Id;                            /* task ID: read only */
  61.         ULONG tp_Nice;                          /* NICE value: read only */
  62. }; /* don't depend on sizeof(TaskPPC) */
  63.  
  64. #define NT_PPCTASK 100
  65.  
  66. /* tc_State (additional task states) */
  67.  
  68. #define TS_CHANGING      7
  69.  
  70. /* tp_Flags */
  71.  
  72. #define TASKPPCB_SYSTEM    0
  73. #define TASKPPCB_BAT       1
  74. #define TASKPPCB_THROW     2
  75.  
  76. #define TASKPPCF_SYSTEM    (1L<<0)
  77. #define TASKPPCF_BAT       (1L<<1)
  78. #define TASKPPCF_THROW     (1L<<2)
  79.  
  80. /* tags passed to CreateTaskPPC */
  81.  
  82. #define TASKATTR_TAGS       (TAG_USER+0x100000)
  83. #define TASKATTR_CODE       (TASKATTR_TAGS+0)   /* entry code */
  84. #define TASKATTR_EXITCODE   (TASKATTR_TAGS+1)   /* exit code */
  85. #define TASKATTR_NAME       (TASKATTR_TAGS+2)   /* task name */
  86. #define TASKATTR_PRI        (TASKATTR_TAGS+3)   /* task priority */
  87. #define TASKATTR_STACKSIZE  (TASKATTR_TAGS+4)   /* task stacksize */
  88. #define TASKATTR_R2         (TASKATTR_TAGS+5)   /* smalldata/TOC base */
  89. #define TASKATTR_R3         (TASKATTR_TAGS+6)   /* first parameter */
  90. #define TASKATTR_R4         (TASKATTR_TAGS+7)
  91. #define TASKATTR_R5         (TASKATTR_TAGS+8)
  92. #define TASKATTR_R6         (TASKATTR_TAGS+9)
  93. #define TASKATTR_R7         (TASKATTR_TAGS+10)
  94. #define TASKATTR_R8         (TASKATTR_TAGS+11)
  95. #define TASKATTR_R9         (TASKATTR_TAGS+12)
  96. #define TASKATTR_R10        (TASKATTR_TAGS+13)
  97. #define TASKATTR_SYSTEM     (TASKATTR_TAGS+14)  /* private */
  98. #define TASKATTR_MOTHERPRI  (TASKATTR_TAGS+15)  /* inherit mothers pri */
  99. #define TASKATTR_BAT        (TASKATTR_TAGS+16)  /* BAT MMU setup (BOOL) */
  100. #define TASKATTR_NICE       (TASKATTR_TAGS+17)  /* initial NICE value (-20..20)*/
  101.  
  102. /* taskptr structure */
  103.  
  104. struct TaskPtr {
  105.         struct Node tptr_Node;
  106.         APTR tptr_Task;
  107. };
  108.  
  109. /* return values of ChangeStack */
  110.  
  111. #define CHSTACK_SUCCESS  -1
  112. #define CHSTACK_NOMEM    0
  113.  
  114. /* parameter to ChangeMMU */
  115.  
  116. #define CHMMU_STANDARD   1
  117. #define CHMMU_BAT        2
  118.  
  119. /* tags passed to SnoopTask */
  120.  
  121. #define SNOOP_TAGS          (TAG_USER+0x103000)
  122. #define SNOOP_CODE          (TASKATTR_TAGS+0)   /* pointer to callback function */
  123. #define SNOOP_DATA          (TASKATTR_TAGS+1)   /* custom data, passed in r2 */
  124. #define SNOOP_TYPE          (TASKATTR_TAGS+2)   /* snoop type (see below) */
  125.  
  126. /* possible values of SNOOP_TYPE */
  127.  
  128. #define SNOOP_START     1                       /*monitor task start */
  129. #define SNOOP_EXIT      2                       /*monitor task exit */
  130.  
  131. /* possible values for the CreatorCPU parameter of the callback function */
  132.  
  133. #define CREATOR_PPC     1
  134. #define CREATOR_68K     2
  135.  
  136. #endif
  137.